// Date:   Sun Nov 10 15:10:52 2024
// Mail:   lunar_ubuntu@qq.com
// Author: https://github.com/xiaoqixian

// P = M/M * (M-1)/M * ... * (M-N+1)/M
pub fn new_birthday_probability(n: u32) -> f64 {
    const M: u32 = 365;
    let mut p = 1f64;
    for i in (M - n + 1)..M {
        p *= (i as f64) / (M as f64);
    }
    1f64 - p
}
